package short_semester.questionnaire_planet.response.AnalyseController;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import short_semester.questionnaire_planet.pojo.Questionnaire;
import short_semester.questionnaire_planet.pojo.QuestionnaireRecord;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RecordsResponse {
    Integer recordId;
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    Date date;
    Long completeTime;
    String ip;
    String province;
    String city;
    public RecordsResponse(QuestionnaireRecord record) {
        recordId = record.getId();
        date = record.getSubmitDate();
        completeTime = record.getConsTime();
        ip = record.getIp();
        province = record.getProvince();
        city = record.getCity();
    }
}
